package com.hmall.hmallapi.api;

import com.hmall.hmallapi.config.DefaultFeignConfig;
import com.hmall.hmallapi.fallback.CartServiceFallBack;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;

/**
 * @author malty
 */
@FeignClient(name = "cart-service", configuration = DefaultFeignConfig.class, fallbackFactory = CartServiceFallBack.class)
public interface CartService {

    @DeleteMapping("/carts/{id}")
    void deleteCartItem(@Param("购物车条目id") @PathVariable("id") Long id);

    @DeleteMapping("/carts")
    void removeByItemIds(@RequestParam("ids") Collection<Long> ids);
}
